package org.lxg.springmvc.controller;

import org.lxg.springmvc.dao.UserMapper;
import org.lxg.springmvc.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ContextDemo {

    public static void main(String[] args) {

        ApplicationContext ac = new ClassPathXmlApplicationContext("classpath:spring.xml");
        UserMapper u = ac.getBean(UserMapper.class);
        System.out.println(u.findAllUsers());

        UserService s = ac.getBean(UserService.class);
        System.out.println(s.findUsers());

        SpringmvcController c = ac.getBean(SpringmvcController.class);
        System.out.println(c.findUsers());
    }

}